﻿@using eCollabro.Client.Models.Content;
@using eCollabro.Client.Models.Core;
@using eCollabro.Web.Base;
@model BlogModel
@if (!Request.IsAjaxRequest())
{
    <script type="text/javascript" src="~/Areas/Content/app/controllers/blog/dashboardWidget.js"></script>
}
<div id="divBlogHome" ng-controller="blogDashboardWidgetController" ng-init="initialize()">
    <div class="panel panel-default">
        <!-- Default panel contents -->
        <div class="panel-heading"><span ng-click="changeCaption()" data-toggle="collapse" title="expand/collapse" data-target="#collapseBlog" class="{{caption}} text-primary"></span> Recent Blogs <span class="badge">{{recentBlogs.length}}</span></div>
        <div id="collapseBlog" class="panel-collapse collapse in">
            <div class="panel-body widget">
                <div id="divSummaryMessageBlogWidget"></div>
                <ul class="list-group">
                    <li class="list-group-item" ng-repeat="blog in recentBlogs">
                        <p class="list-group-item-heading"><a href="/content/blog/blog/{{blog.BlogId}}">{{blog.BlogTitle}}</a></p>
                        <p class="list-group-item-text"> {{blog.BlogDescription}}</p>
                    </li>
                </ul>
                <div ng-show="recentBlogs.length==0" class="text-info">There are no records to show.</div>
            </div>
            <div class="panel-footer"><a href="/content/blog/">Blog Home</a> | <a href="/content/blog/blogcategories">Blog Categories</a></div>
        </div>
    </div>
</div>
